using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using Yoozoo.UI;
public class YToggleBinderTreeItem : BindingBinderTreeItemBase
{
    public static Dictionary<YToggleBinder.AttributeType, LinkerValueState> AttributeValueDic = new Dictionary<YToggleBinder.AttributeType, LinkerValueState>
    {
        {YToggleBinder.AttributeType.onValueChanged, LinkerValueState.UnityEvent2Boolean},
        {YToggleBinder.AttributeType.on, LinkerValueState.UnityEvent2},
        {YToggleBinder.AttributeType.off, LinkerValueState.UnityEvent2},
        {YToggleBinder.AttributeType.isOn, LinkerValueState.Boolean},
        {YToggleBinder.AttributeType.interactable, LinkerValueState.Boolean},
        {YToggleBinder.AttributeType.enabled, LinkerValueState.Boolean},
    };
    public YToggleBinderTreeItem() : base(typeof(YToggleBinder))
    {
    }
    
    public override void RebuildTree()
    {
        base.RebuildTree();
        foreach (YToggleBinder.AttributeType binderType in Enum.GetValues(typeof(YToggleBinder.AttributeType)))
        {
            BindingLinkerTreeItem linkerTreeItem = new BindingLinkerTreeItem(binderType.ToString(), binderType.ToString(), (int)AttributeValueDic[binderType]);
            AddChild(linkerTreeItem);
        }
    }
}